var _n67;
var cc__extends = __extends;
var cc__importDefault = __importDefault;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var def_localStorageService = function (t) {
  function _ctor() {
    const e = (t.call(this) || this); // 调用父类构造函数并确保上下文

    // 初始化服务名称和存储前缀
    e._serviceName = "本地缓存服务";
    e.keyPrefix = "UMeGame-";
    e.localStorage = undefined; // 可以考虑实际初始化为 localStorage

    e._Initialize(); // 调用初始化方法
    return e; // 返回当前实例
  }
  cc__extends(_ctor, t);
  _ctor.prototype._Initialize = function () {
    t.prototype._Initialize.call(this);
    this.localStorage = cc.sys.localStorage;
  };
  _ctor.prototype.set = function (t, e) {
    // 检查 localStorage 是否可用并设置缓存
    if (this.localStorage !== undefined) {
      this.localStorage.setItem(this.keyPrefix + t, e); // 设置本地存储项
    } else {
      console.error("本地缓存服务未正常工作 --- localStorage属性未赋值"); // 输出错误信息
    }
  };
  _ctor.prototype.get = function (t) {
    // 检查 localStorage 是否可用并获取缓存的值
    if (this.localStorage === undefined) {
      console.error("本地缓存服务未正常工作 --- localStorage属性未赋值"); // 输出错误信息
      return null; // 返回 null 表示未能获取值
    } else {
      return this.localStorage.getItem(this.keyPrefix + t); // 获取并返回本地存储的项
    }
  };
  return _ctor;
}(cc__importDefault(require("zqcc_frameNamespace")).default.zqcc_ServiceBase);
exports.default = def_localStorageService;